import java.util.Scanner;

public class Calcutor {

    public void plus(int num,int mul){
        int sum=num+mul;
        System.out.println(num+"+"+mul+"="+sum);
    }
    public void subtract(int num,int mul){
        int sum=num-mul;
        System.out.println(num+"-"+mul+"="+sum);
    }
    public void ride(int num,int mul){
        int sum=num*mul;
        System.out.println(num+"x"+mul+"="+sum);
    }
    public void divide(int num,int mul){
        int sum=num/mul;
        System.out.println(num+"/"+mul+"="+sum);
    }
    public void delivery(int num,int mul){
        int sum=num%mul;
        System.out.println(num+"%"+mul+"="+sum);
    }
    public void sfactorial(int num){
        int sum=1;
        for (int i=1;i<num;i++){
            sum*=i;
        }
        System.out.println("num!为："+sum);
    }
    public void square(int num){
        int sum=num*num;
        System.out.println(num+"的平方为："+sum);
    }
    public void cube(int num){
        int sum=num*num*num;
        System.out.println(num+"的立方为："+sum);
    }

    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        Calcutor m=new Calcutor();
        System.out.println("请输入第一个数");
        int num=input.nextInt();
        System.out.println("请输入想要的运算符：");
        String ch=input.next();
        switch (ch){
            case "+":
                System.out.println("请输入第二个数");
                int mul=input.nextInt();
                m.plus(num,mul);
                break;
            case "-":
                System.out.println("请输入第二个数");
                 mul=input.nextInt();
                 m.subtract(num,mul);
                 break;
            case "*":
                System.out.println("请输入第二个数");
                mul=input.nextInt();
                m.ride(num,mul);
                break;
            case "/":
                System.out.println("请输入第二个数");
                mul=input.nextInt();
                m.divide(num,mul);
                break;
            case "%":
                System.out.println("请输入第二个数");
                mul=input.nextInt();
                m.delivery(num,mul);
                break;
            case "!":
                m.sfactorial(num);
                break;
            case "平方":
                m.square(num);
                break;
            case "立方":
                m.cube(num);
                break;
            default:
                System.out.println("输入的运算符不存在");
                break;
        }
    }
}
